﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using MockServer.Models;
using Microsoft.AspNetCore.Cors;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace MockServer.apps
{
    [Route("apps/share/[controller]")]
    [EnableCors("any")] 
    public class ActiveListController : Controller
    {
        // GET: api/values
        [HttpGet]
        public IEnumerable<UserModel> Get()
        {
            // return "bcd";
            var users = new List<UserModel>();
            users.Add(new UserModel("1", "ddd", "abcc", true));
            users.Add(new UserModel("2", "aaa", "dddd", true));
            users.Add(new UserModel("3", "aaaa", "abssssscc", true));
            return users;
            //return new string[] { "value1", "value2" };
            // Json(new UserModel("3", "aaaa", "abssssscc", true));

        }

        // GET api/values/5
        [HttpGet("{id}")]
        public string Get(int id)
        {
            return "value";
        }

        // POST api/values
        [HttpPost]
        public void Post([FromBody]string value)
        {
        }

        // PUT api/values/5
        [HttpPut("{id}")]
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE api/values/5
        [HttpDelete("{id}")]
        public void Delete(int id)
        {
        }
    }
}
